import { http } from "@/utils/http";

type Result = {
  code: Number;
  message: string;
  result: any;
};

/** 获取摄像头列表 */
export const getCameraList = params => {
  return http.request<Result>("get", "/api/camera", { params });
};

/** 编辑摄像头 */
export const editCameraList = data => {
  return http.request<Result>("put", "/api/camera", { data });
};

/** 删除摄像头 */
export const deleteCameraList = data => {
  return http.request<Result>("delete", "/api/camera", { data });
};

/** 扫描摄像头 */
export const scanCamera = () => {
  return http.request<Result>("get", "/api/camera/discovery");
};

/** 检测摄像头 */
export const detectionCamera = data => {
  return http.request<Result>("post", "/api/camera/check_connection", { data });
};

/** 添加摄像头 */
export const addCamera = data => {
  return http.request<Result>("post", "/api/camera", { data });
};
